
public class W05PractitalClass {
	
	public static boolean is0orGreater(float number){
		if(number>=0){
			return true;
		}
		else{
			return false;
		}
	}
	
	public static float receiveValueOfDistanceInMetres(){
		System.out.println("Please enter the length of the distance in metres. " +
				"Use only values greater or equal to 0: ");
		float distance = EasyIn.getFloat(); 
		boolean check = is0orGreater(distance);
		while(!check){
			System.out.println("You entered a value less than 0. " +
					"Enter number greater or equal to 0: ");
			distance = EasyIn.getFloat();
			check = is0orGreater(distance);
		}
		return distance;
	}
	
	public static void main(String[] args){
		
		float distanceInMetres = receiveValueOfDistanceInMetres();
		Distance distance = new Distance(distanceInMetres);
		
		distance.printDistanceFromUserChoice();
		
	}

}
